import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main'
import Login from '../views/Login'
import page1 from '../views/Page1'
import brand from '../views/Brand'
import template from '../views/Template'
import spec from '../views/Spec'
import para from '../views/Para'
import category from '../views/Category'
import album from '../views/Album'
import albumList from '../views/AlbumList'
import goods from '../views/Goods'
import goodsEdit from '../views/GoodsEdit'
import goodsVerify from '../views/GoodsVerify'
import categoryReport from '../views/CategoryReport'
import transactionReport from '../views/TransactionReport'
import loginLog from '../views/LoginLog'
import AccountSetting from '../views/AccountSetting'
import userSetting from '../views/UserSetting'
import adminList from '../views/AdminList'
import adminSetting from '../views/AdminSetting'
import adList from '../views/AdList'
import adEdit from '../views/AdEdit'
import returnGoods from '../views/ReturnGoodsList'
import returnDetails from '../views/ReturnDetails'
import orderList from '../views/OrderList'

import test from '../views/test'
import baiduMap from '../views/baiduMap'

Vue.use(VueRouter)

const routes = [
  { path:'/login',component: Login, meta: { isPublic: true }},
  {
    path: '/',
    name: '首页',
    component: Main,
    redirect: '/page1',
    children: [
       {path: "/baiduMap",name: 'baiduMap',component: baiduMap},
       {path: "/test",name: 'test',component: test},
       {path: "/page1",name: 'page1',component: page1},
       {path: "/index/AccountSetting",name: '账户设置',component: AccountSetting},
       {path: "/index/loginLog",name: '登录日志',component: loginLog},

    ]
  },
  
  {
    path: '/goods',
    name: '商品',
    component: Main,
    redirect: '/goods/List',
    children: [
       {path: "/brand",name: '品牌管理',component: brand},
       {path: "/goods/List",name: '商品列表',component: goods},
       {path: "/goods/Verify",name: '商品审核',component: goodsVerify},
       {path: "/goods/Edit/:id",name: '添加商品',component: goodsEdit,props: true},

    ]
  },
  {
    path: '/order',
    name: '订单',
    component: Main,
    redirect: '/order/List',
    children: [
       {path: '/order/List',name: '订单列表',component: orderList},
       {path: "/order/returnGoodsList",name: '退货申请列表',component: returnGoods},
       {path: "/order/returnDetails/:id",name: '退货申请处理',component: returnDetails},

    ]
  },
  {
    path: '/goodsSet',
    name: '商品配置',
    component: Main,
    redirect: '/category',
    children: [
       {path: "/album",name: '相册管理',component: album},
       {path: "/album/albumList",name: '相册列表',component: albumList,props: true},
       {path: "/category",name: '商品分类',component: category},
       {path: "/template",name: '模板管理',component: template},
       {path: "/spec/:id",name: 'spec',component: spec,props: true},
       {path: "/para/:id",name: 'para',component: para,props: true},

    ]
  },
  {
    path: '/report',
    name: '统计管理',
    component: Main,
    redirect: '/category/Report',
    children: [
      
       {path: "/category/Report",name: '分类统计',component: categoryReport},
       {path: "/transaction/Report",name: '交易统计',component: transactionReport},
       

    ]
  },
  {
    path: '/Operate',
    name: '运营',
    component: Main,
    redirect: '/operate/adList',
    children: [
      
       {path: '/operate/adList',name: '广告列表',component: adList},
       {path: "/operate/adEdit/:id",name: '添加广告',component: adEdit,props: true},
       

    ]
  },
  {
    path: '/setting',
    name: '设置',
    component: Main,
    redirect: '/setting/userSetting',
    children: [
      
       {path: "/setting/userSetting",name: '成员管理',component: userSetting},
       {path: "/setting/adminList",name: '角色管理',component: adminList},
       {path: "/setting/adminSetting/:id",name: '角色设置',component: adminSetting,props: true},
       
       

    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
